/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.comment
 * ICommentService.java
 * 创建人:小胡 
 * 时间：2017年01月18日 10:25:33
 *
 */
package com.tz.service.comment.impl;

import com.tz.bean.Comment;
import com.tz.bean.TzParams;
import com.tz.dao.comment.ICommentMapper;
import com.tz.service.comment.ICommentService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 商城评价管理serviceImpl
 * ICommentService
 * 创建人:小胡 
 * 时间：2017年01月18日 10:25:33
 * @version 1.0.0
 * 
 */
@Service
public class CommentServiceImpl implements ICommentService{

	@Autowired
	private ICommentMapper commentMapper;
	
	@Override
	public List<HashMap<String,Object>> findComments(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("sg.create_time desc");
		return commentMapper.findComments(params);
	}
	
	@Override
	public int count(TzParams params) {
		return commentMapper.count(params);
	}

	@Override
	public HashMap<String ,Object> getComment(Integer id) {
		return commentMapper.getComment(id);
	}

	@Override
	public int save(Comment comment) {
		return commentMapper.save(comment);
	}

	@Override
	public int update(Comment comment) {
		return commentMapper.update(comment);
	}

	@Override
	public int delete(TzParams params) {
		return commentMapper.delete(params);
	}

	@Override
	public List<HashMap<String, Object>> getPictures(Integer id) {
		return commentMapper.getPictures(id);
	}
}
